6.2 Collections: Tuples, Sets and Matrices
Myron supports three types of collection: tuples, sets and matrices. Tuples are lists constrained by order, sets are lists constrained by uniqueness and matrices are lists of tuples with matching tuple length. The elements of each collection type can be any expression, real, scalar or otherwise. Each collection type has its own input syntax and its own display representation for values of that type. Collection values can be bound to collection variables, which also have their own input syntax and display for each type. Each collection type also has a generator that can be configured to summarize certain collection values.
A collection value displays both the structure and the content of a collection. Collection values and collection variables are described here. The description of tuples is lengthy because it introduces notions that are exploited by sets and matrices. Examples of generators are given as opportunities arise, such as where it is natural for an example to complete a description, but a full description of generators is deferred to §6.3.